// 模块组分发
import { MappingData } from '../Config/MappingData'

import TemplateA01 from './TemplateA01'
import TemplateA02 from './TemplateA02'




// 定制模块
import TempCustomizeA01 from './TempCustomizeA01'
// 图文列表
import TempImageTextA01 from './TempImageTextA01'
import TempImageTextA02 from './TempImageTextA02'
import TempImageTextA03 from './TempImageTextA03'
import TempImageTextA04 from './TempImageTextA04'
// 占位模块
import TempPlaceholderA01 from './TempPlaceholderA01'
import TempPlaceholderA02 from './TempPlaceholderA02'


// 图例
import TempChartsA01 from './TempChartsA01'
import TempChartsA02 from './TempChartsA02'
import TempChartsA03 from './TempChartsA03'
import TempChartsA04 from './TempChartsA04'
import TempChartsA05 from './TempChartsA05'
import TempChartsA06 from './TempChartsA06'
import TempChartsA07 from './TempChartsA07'
import TempChartsA08 from './TempChartsA08'
import TempChartsA09 from './TempChartsA09'
import TempChartsA10 from './TempChartsA10'


import OptionsTempA01 from './OptionsTempA01'
import OptionsTempA02 from './OptionsTempA02'
import OptionsTempA03 from './OptionsTempA03'


import OptionsComA01 from './OptionsComA01'

import TemplateOnlyA01 from './TemplateOnlyA01'




const TemplateCommonParams = {
    title: [
        { formType: 'TempTitle', label: '标题设置', name: 'title' },

        { span: 24, formType: 'RADIO', name: 'smallWindow', label: '系统小窗', rules: true, valueEnum: MappingData.IsEnabledBool },
        { span: 24, formType: 'INPUT', name: 'smallTitle', label: '小窗标题', rules: true, jugdeField: 'smallWindow', jugdeValue: [true] },

        { span: 24, formType: 'INPUT', name: 'titleText', label: '模块标题', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        { span: 24, formType: 'COLOR', name: 'titleColor', label: '标题颜色', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        { span: 24, formType: 'NUMBER', name: 'titleSize', label: '标题字号', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        {
            span: 24, formType: 'SELECT', name: 'titleFamily', label: '标题字体', valueEnum: MappingData.Font__Family,
            jugdeField: 'smallWindow', jugdeValue: [false]
        },
        {
            span: 24, formType: 'RADIO', name: 'titleWeight', label: '标题加粗', rules: true, valueEnum: MappingData.Font__WeightInt,
            jugdeField: 'smallWindow', jugdeValue: [false]
        },
        {
            span: 24, formType: 'RADIO', name: 'titleStyle', label: '标题倾斜', rules: true, valueEnum: MappingData.Font__Style,
            jugdeField: 'smallWindow', jugdeValue: [false]
        },
        { span: 24, formType: 'NUMBER', name: 'titleShadowX', label: '阴影X轴', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        { span: 24, formType: 'NUMBER', name: 'titleShadowY', label: '阴影Y轴', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        { span: 24, formType: 'NUMBER', name: 'titleShadowS', label: '阴影尺寸', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
        { span: 24, formType: 'COLOR', name: 'titleShadowB', label: '阴影颜色', rules: true, jugdeField: 'smallWindow', jugdeValue: [false] },
    ],

    params: [
        { formType: 'TempTitle', label: '接口设置', name: 'alvoa' },
        { span: 24, formType: 'RADIO', name: 'apiType', label: '是否使用公共数据', rules: true, valueEnum: MappingData.IsEnabledBool },
        // 公共数据
        { span: 24, formType: 'INPUT', name: 'apiName', label: '接口名称', rules: true, tooltip: '全局接口参数', jugdeField: 'apiType', jugdeValue: [true] },
        // 指定数据
        { span: 24, formType: 'INPUT', name: 'apiUrl', label: '接口地址', rules: true, tooltip: '获取数据接口', jugdeField: 'apiType', jugdeValue: [false] },
        {
            span: 24, formType: 'RADIO', name: 'method', label: '请求方式', rules: true, valueEnum: MappingData.System__Method,
            jugdeField: 'apiType', jugdeValue: [false]
        },
        { span: 24, formType: 'INPUT', name: 'params', label: '额外参数', tooltip: '每次请求自动带入参数', jugdeField: 'apiType', jugdeValue: [false] },
        // 通用参数
        { span: 24, formType: 'INPUT', name: 'hierarchy', label: '数据层级', rules: true, tooltip: '可用数据层级' },
    ],

    background: [
        { formType: 'TempTitle', label: '背景设置', name: 'background' },
        { span: 24, formType: 'COLOR', name: 'backColor', label: '背景颜色', rules: true },
        { span: 24, formType: 'SELECT', name: 'backShadow', label: '阴影等级', valueEnum: MappingData.Style__BoxShadow },
        { span: 24, formType: 'NUMBER', name: 'backRadius', label: '背景圆角', rules: true },
        { span: 24, formType: 'NUMBER', name: 'backPadding', label: '背景内填充', rules: true },
        { span: 24, formType: 'NUMBER', name: 'backMargin', label: '背景外间距', rules: true },
    ],
    text: [
        { formType: 'TempTitle', label: '文本设置', name: 'label' },
        { span: 24, formType: 'COLOR', name: 'textColor', label: '文本颜色', rules: true },
        { span: 24, formType: 'NUMBER', name: 'textSize', label: '文本字号', rules: true },
        { span: 24, formType: 'SELECT', name: 'textFamily', label: '标题字体', valueEnum: MappingData.Font__Family },
        { span: 24, formType: 'RADIO', name: 'textWeight', label: '标题加粗', rules: true, valueEnum: MappingData.Font__WeightInt },
        { span: 24, formType: 'RADIO', name: 'textStyle', label: '标题倾斜', rules: true, valueEnum: MappingData.Font__Style },
        { span: 24, formType: 'NUMBER', name: 'textShadowX', label: '阴影X轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'textShadowY', label: '阴影Y轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'textShadowS', label: '阴影尺寸', rules: true },
        { span: 24, formType: 'COLOR', name: 'textShadowB', label: '阴影颜色', rules: true },
    ],
    value: [
        { formType: 'TempTitle', label: '数值设置', name: 'value' },
        { span: 24, formType: 'COLOR', name: 'valueColor', label: '文本颜色', rules: true },
        { span: 24, formType: 'NUMBER', name: 'valueSize', label: '文本字号', rules: true },
        { span: 24, formType: 'SELECT', name: 'valueFamily', label: '标题字体', valueEnum: MappingData.Font__Family },
        { span: 24, formType: 'RADIO', name: 'valueWeight', label: '标题加粗', rules: true, valueEnum: MappingData.Font__WeightInt },
        { span: 24, formType: 'RADIO', name: 'valueStyle', label: '标题倾斜', rules: true, valueEnum: MappingData.Font__Style },
        { span: 24, formType: 'NUMBER', name: 'valueShadowX', label: '阴影X轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'valueShadowY', label: '阴影Y轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'valueShadowS', label: '阴影尺寸', rules: true },
        { span: 24, formType: 'COLOR', name: 'valueShadowB', label: '阴影颜色', rules: true },
    ],
    icon: [
        { formType: 'TempTitle', label: '图标设置', name: 'icon' },
        { span: 24, formType: 'NUMBER', name: 'iconSize', label: '图标尺寸', rules: true },
        { span: 24, formType: 'COLOR', name: 'iconColor', label: '图标颜色', rules: true },
        { span: 24, formType: 'NUMBER', name: 'iconShadowX', label: '阴影X轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'iconShadowY', label: '阴影Y轴', rules: true },
        { span: 24, formType: 'NUMBER', name: 'iconShadowS', label: '阴影尺寸', rules: true },
        { span: 24, formType: 'COLOR', name: 'iconShadowB', label: '阴影颜色', rules: true },
    ],
    search: [

    ]
}

const TemplateA01Params = [
    ...TemplateCommonParams.params,
    ...TemplateCommonParams.background,
    {
        span: 24, formType: 'LIST', name: 'dataArr', label: '数据分组',
        children: [
            { span: 24, formType: 'INPUT', name: 'key', label: '字段', rules: true },
            { span: 24, formType: 'INPUT', name: 'label', label: '映射名称', rules: true },
            { span: 24, formType: 'SELECT', name: 'image', label: '附件类型', rules: true, valueEnum: MappingData.System__FilesType },
            { span: 24, formType: 'INPUT', name: 'files', label: '附件地址', rules: true, jugdeField: 'image', jugdeValue: ['img'] },
            { span: 24, formType: 'TempICON', name: 'icon', label: '操作图标', jugdeField: 'image', jugdeValue: ['icon'] },
        ]
    },
    ...TemplateCommonParams.text,
    ...TemplateCommonParams.value,
    ...TemplateCommonParams.icon,
]

const TemplateA02Params = [
    ...TemplateCommonParams.params,
    ...TemplateCommonParams.title,
    ...TemplateCommonParams.background,
    {
        span: 24, formType: 'LIST', name: 'dataArr', label: '数据分组',
        children: [
            { span: 24, formType: 'INPUT', name: 'key', label: '字段', rules: true },
            { span: 24, formType: 'INPUT', name: 'label', label: '映射名称', rules: true },
            { span: 24, formType: 'SELECT', name: 'image', label: '附件类型', rules: true, valueEnum: MappingData.System__FilesType },
            { span: 24, formType: 'INPUT', name: 'files', label: '附件地址', rules: true, jugdeField: 'image', jugdeValue: ['img'] },
            { span: 24, formType: 'TempICON', name: 'icon', label: '操作图标', jugdeField: 'image', jugdeValue: ['icon'] },
        ]
    },
    ...TemplateCommonParams.text,
    { span: 24, formType: 'NUMBER', name: 'textBottom', label: '标题下填充', rules: true },
    ...TemplateCommonParams.value,
    ...TemplateCommonParams.icon,
    { span: 24, formType: 'NUMBER', name: 'iconLeft', label: '图标左填充', rules: true },
    { span: 24, formType: 'NUMBER', name: 'iconRight', label: '图标右填充', rules: true },
]


const TempChartsA01Params = [
    ...TemplateCommonParams.params,
    {
        span: 24, formType: 'LIST', name: 'dataArr', label: '数据分组',
        children: [
            { span: 24, formType: 'INPUT', name: 'xField', label: '名称', rules: true },
            { span: 24, formType: 'INPUT', name: 'yField', label: '数值', rules: true },
            { span: 24, formType: 'INPUT', name: 'seriesField', label: '分组' },
            { span: 24, formType: 'COLOR', name: 'color', label: '颜色', rules: true },
        ]
    },
]


export const TemplateCommon = {
    // 定制模块
    CustomizeA01: { name: 'CustomizeA01', title: '交投AI预警', type: ['定制模块'], temp: TempCustomizeA01 },
    // 图文列表
    ImageTextA01: { name: 'ImageTextA01', title: '图片&数值 - A01', type: ['图文列表'], temp: TempImageTextA01 },
    ImageTextA02: { name: 'ImageTextA02', title: '列表块 - A02', type: ['图文列表'], temp: TempImageTextA02 },
    ImageTextA03: { name: 'ImageTextA03', title: '列表块 - A03', type: ['图文列表'], temp: TempImageTextA03 },
    ImageTextA04: { name: 'ImageTextA04', title: '图标列表 - A04', type: ['图文列表'], temp: TempImageTextA04 },


    Chart01: { name: 'Chart01', title: '折线图&面积图', type: ['图例'], temp: TempChartsA01 },
    Chart02: { name: 'Chart02', title: '柱状图', type: ['图例'], temp: TempChartsA02 },
    Chart03: { name: 'Chart03', title: '直方图', type: ['图例'], temp: TempChartsA03 },
    Chart04: { name: 'Chart04', title: '区间柱图', type: ['图例'], temp: TempChartsA04 },
    Chart05: { name: 'Chart05', title: '饼图&环图', type: ['图例'], temp: TempChartsA05 },
    Chart06: { name: 'Chart06', title: '玫瑰图', type: ['图例'], temp: TempChartsA06 },
    Chart07: { name: 'Chart07', title: '雷达图', type: ['图例'], temp: TempChartsA07 },
    Chart08: { name: 'Chart08', title: '仪表盘', type: ['图例'], temp: TempChartsA08 },
    Chart09: { name: 'Chart09', title: '进度图', type: ['图例'], temp: TempChartsA09 },
    Chart10: { name: 'Chart10', title: '水波图', type: ['图例'], temp: TempChartsA10 },

    Options01: { name: 'Options01', title: '类Nav导航', type: ['操作'], temp: OptionsTempA01 },
    Options02: { name: 'Options02', title: '下拉选择器', type: ['操作'], temp: OptionsTempA02 },
    Options03: { name: 'Options03', title: '分页器 - 1', type: ['操作'], temp: OptionsTempA03 },


    OptionsComA01: { name: 'OptionsComA01', title: '组织机构树(交投)', type: ['操作'], temp: OptionsComA01 },

    // 占位模块
    // PlaceholderA01: { name: 'PlaceholderA01', title: '空占位', type: ['占位'], temp: TempPlaceholderA01 },
    PlaceholderA02: { name: 'PlaceholderA02', title: '文字占位', type: ['占位'], temp: TempPlaceholderA02 },


    // 唯一独立模块
    OnlyA01: { name: 'OnlyA01', title: '视频监控-A01', type: ['独立'], temp: TemplateOnlyA01 },




    // A01: { name: 'A01', temp: TemplateA01, params: TemplateA01Params, title: '多连数据', type: ['多块', '数据展示'] },
    // A02: { name: 'A02', temp: TemplateA02, params: TemplateA02Params, title: '固定模块', type: ['数据展示'] },
    // C09: { name: 'C09', temp: TempChartsA01, params: TempChartsA01Params, title: '漏斗图', type: ['图例'] },
    // C10: { name: 'C10', temp: TempChartsA01, params: TempChartsA01Params, title: '散点图', type: ['图例'] },
    // C12: { name: 'C12', temp: TempChartsA01, params: TempChartsA01Params, title: '地图', type: ['图例'] },
    // C13: { name: 'C13', temp: TempChartsA01, params: TempChartsA01Params, title: '桑吉图', type: ['图例'] },
    // C14: { name: 'C14', temp: TempChartsA01, params: TempChartsA01Params, title: '时序图', type: ['图例'] },
    // C15: { name: 'C15', temp: TempChartsA01, params: TempChartsA01Params, title: '词云', type: ['图例'] },
    // C18: { name: 'C18', temp: TempChartsA01, params: TempChartsA01Params, title: '树图', type: ['图例'] },
    // C19: { name: 'C19', temp: TempChartsA01, params: TempChartsA01Params, title: '瀑布图', type: ['图例'] },
    // C20: { name: 'C20', temp: TempChartsA01, params: TempChartsA01Params, title: '热图', type: ['图例'] },
    // C21: { name: 'C21', temp: TempChartsA01, params: TempChartsA01Params, title: '嵌套圆', type: ['图例'] },
    // C22: { name: 'C22', temp: TempChartsA01, params: TempChartsA01Params, title: '旭日图', type: ['图例'] },
    // C23: { name: 'C23', temp: TempChartsA01, params: TempChartsA01Params, title: '散点相关', type: ['图例'] },
    // C24: { name: 'C24', temp: TempChartsA01, params: TempChartsA01Params, title: '组合图', type: ['图例'] },
    // C26: { name: 'C26', temp: TempChartsA01, params: TempChartsA01Params, title: '韦恩图', type: ['图例'] },
    // C27: { name: 'C27', temp: TempChartsA01, params: TempChartsA01Params, title: '马赛克图', type: ['图例'] },
    // C28: { name: 'C28', temp: TempChartsA01, params: TempChartsA01Params, title: '象形图', type: ['图例'] },
    // C29: { name: 'C29', temp: TempChartsA01, params: TempChartsA01Params, title: '透视图', type: ['图例'] },
    // C30: { name: 'C30', temp: TempChartsA01, params: TempChartsA01Params, title: '日历图', type: ['图例'] },
    // C31: { name: 'C31', temp: TempChartsA01, params: TempChartsA01Params, title: '甘特图', type: ['图例'] },
    // C32: { name: 'C32', temp: TempChartsA01, params: TempChartsA01Params, title: '拓展图', type: ['图例'] },
    // C33: { name: 'C33', temp: TempChartsA01, params: TempChartsA01Params, title: '三维图', type: ['图例'] },
}


